<?php
/*
Mongo('mongodb://username:password@host:port')
$collection = (new Mongo("mongodb://192.168.142.132"))->mydb->test;
*/

$data = array("A" => "1", "B" => "2");
print_r($data);
print("<br/><br/>");

insertByCollection("article", $data);

function insertByCollection($collectionName, $data) {
	// Declare Connection.
	$db = (new Mongo())->aci;
	$collection = new MongoCollection($db, $collectionName);
	
	// Insert
	$collection->insert($data);
}
?>